##
## Makefile for libmxs in /home/rannou_s/work/c/tools
## 
## Made by sebastien rannou
## Login   <rannou_s@epitech.net>
## 
## Started on  Sun Sep  6 19:21:13 2009 sebastien rannou
## Last update Sun Sep  6 20:49:53 2009 sebastien rannou
##

LIBNAME	=	mxs
BINNAME	=	lib$(LIBNAME).a

# System settings

CC	=	gcc
RM	=	rm -rf
AR	=	ar
RANLIB	=	ranlib
MV	=	mv
MAKE	=	make
FIND	=	find
CP	=	cp

# Default sources

SOURCES	=

# Dependencies

.ifdef	NO_LIST
NO_INI = 1
.endif 

# Options

.ifdef NO_LIST
OPTIONS += 	-DDISABLE_LIST
.else
SOURCES	+=	lists.c
.endif

.ifdef NO_SHA1
OPTIONS += 	-DDISABLE_SHA1
.else
SOURCES	+=	sha1.c
.endif

.ifdef NO_LOG
OPTIONS += 	-DDISABLE_LOG
.else
SOURCES	+=	log.c
.endif

.ifdef NO_ERRORS
OPTIONS += 	-DDISABLE_ERRORS
.else
SOURCES	+=	errors.c
.endif

.ifdef NO_INI
OPTIONS += 	-DDISABLE_INI
.else
SOURCES	+=	ini.c
.endif

# Let's compile that mess!

CFLAGS	=	-W -Wall -pedantic -ansi -std=c99 -I./includes $(OPTIONS) -O2

OBJECTS	=	$(SOURCES:.c=.o)

all:	$(OBJECTS)
	$(AR) r $(BINNAME)
	$(RANLIB) $(BINNAME)

clean:
	$(RM) $(OBJECTS)

fclean:	clean
	$(RM) $(BINNAME)

re:	fclean all

help:
	@echo "These flags are available:"
	@echo ""
	@echo "	-DNO_ERRORS	- disable error module"
	@echo "	-DNO_INI	- disable ini parser module"
	@echo "	-DNO_LOG	- disable log module"
	@echo "	-DNO_SHA1	- disable sha1 module"
	@echo "	-DNO_LIST	- disable list and ini module (as a dependency)"
